import { FetchRequest } from 'kryfe-lib';
import store from '../../store';

const {
  Consts,
  createAPI,
  connectToRedux,
  // resetResponseStatic
} = FetchRequest;

connectToRedux(store);

/*
 // if the schema of response is not like
 // { headers: { responseCode: xxx, responseMessage: xxx }, body: { ... } }
 // you need to reset the response like below
 resetResponseStatic({
 parseHeaders: res => ({
 responseCode: res.showapi_res_code,
 responseMessage: res.showapi_res_error
 }),
 parseBody: res => res.showapi_res_body
 });
 */

export {
  Consts,
  createAPI
};
